<!DOCTYPE html>
<html lang="en">
<head>
    <!--<meta charset="UTF-8">-->
    <script src="/jquery-3.2.1.js"></script>
    <title>removeAttr</title>
    <script type="text/javascript">
        $(document).ready(function () {
            $("button").click(function () {
                $("h2").removeAttr("style");
            });
        });
    </script>
</head>
<body>
<button type="button">移除属性</button>
<h2 style="text-align: center">居中标题</h2>
</body>
</html>